﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BaMusaSoft.RPS.ViewModel;
using WinForms = System.Windows.Forms;
using BaMusaSoft.RPS.View.Services;
namespace BaMusaSoft.RPS.View
{
    /// <summary>
    /// Interaction logic for SettingsView.xaml
    /// </summary>
    public partial class SettingsView : UserControl
    {
        public SettingsView()
        {
            InitializeComponent();

        }

        //SettingsViewModel vm;
        private void ViewLoaded(object sender, RoutedEventArgs e)
        {
            // vm = (SettingsViewModel)this.DataContext;
            // vm.OpenDialog += new EventHandler<NotificationEventArgs<ViewModel.HelperClasses.DialogType, string>>(OpenDialog);
            //vm.AskQuestion +=new EventHandler<NotificationEventArgs<string,bool>>(Helper.AskQuestionEvent);
        }

        //void OpenDialog(object sender, NotificationEventArgs<ViewModel.HelperClasses.DialogType, string> e)
        //{
        //    switch (e.Data)
        //    {
        //        case BaMusaSoft.RPS.ViewModel.HelperClasses.DialogType.OpenFileDialog:
        //            var fileDiaglo = new WinForms.OpenFileDialog();
        //            if (fileDiaglo.ShowDialog()== WinForms.DialogResult.OK)
        //            {
        //                e.Completed(fileDiaglo.FileName);
        //            }
        //            break;
        //        case BaMusaSoft.RPS.ViewModel.HelperClasses.DialogType.FolderBrowserDialog:
        //            var folderBrowser = new WinForms.FolderBrowserDialog();
        //            if (folderBrowser.ShowDialog() == WinForms.DialogResult.OK)
        //            {
        //                e.Completed(folderBrowser.SelectedPath);
        //            }
        //            break;

        //    }
        //}

       

        private void ViewUnLoaded(object sender, RoutedEventArgs e)
        {
            //vm.OpenDialog -= new EventHandler<NotificationEventArgs<ViewModel.HelperClasses.DialogType, string>>(OpenDialog);
            //vm.AskQuestion -= new EventHandler<NotificationEventArgs<string, bool>>(Helper.AskQuestionEvent);
        }
    }
}
